<?php
class Aspirante extends CFormModel
{
	public $step;
	
	public $tipoDocumento;
	public $numeroDocumento;
	
	public $name ;
	public $body ;
	public $pub_date ;
	public $authors;
 	
	public static function getAuthors() {
                return array('' => '----',
                             'me' => 'Me',
                             'myself' => 'Myself') ;
        }
	
	
	public static function getPubDates() {
                return array('' => '----',
                             '-1' => 'yesterday',
                             '0' => 'today',
                             '1' => 'tomorrow') ;
        }
	
	
	public function rules() {
		return array(
		// name, email, subject and body are required
		array('step, name, body', 'required', 'on' => 'step1'),
		array('step, name, body, pub_date, authors', 'required', 'on' => 'step2'),
		array('step, name, body, pub_date, authors', 'required', 'on' => 'step3'),
		) ;
	}
	
	
	
	 public function preview() {
                $pub_dates = 'test' ;
                $authors = 'author' ;
                return strtr('<h2>%name%</h2><div>%body%</div><hr/><span>Published %pub_date% by %authors%</span>',
                             array('%name%' => $this->name,
                                   '%body%' => nl2br($this->body),
                                   '%pub_date%' => $pub_dates[$this->pub_date],
                                   '%authors%' => $authors[$this->authors])) ;
        }
	
	
}